package org.fhawk.tinyspring.core.imp;

import org.fhawk.tinyspring.core.ClassScanner;
import org.fhawk.tinyspring.core.support.AnnotationClassTemplate;
import org.fhawk.tinyspring.core.support.DefaultClassTemplate;
import org.fhawk.tinyspring.core.support.SupperClassTemplate;
import org.fhawk.tinyspring.core.support.WithoutInterfaceClassTemplate;

import java.lang.annotation.Annotation;
import java.util.List;

/**
 * Created by tuo on 8/17/2016.
 */
public class DefaultClassScanner implements ClassScanner {
    @Override
    public List<Class<?>> getAllClass(String packageName) {
        return new DefaultClassTemplate(packageName).getClassList();
    }

    @Override
    public List<Class<?>> getClassByAnnotation(String packageName, Class<? extends Annotation> anClass) {
        return new AnnotationClassTemplate(packageName, anClass).getClassList();
    }

    @Override
    public List<Class<?>> getClassBySuperClass(String packageName, Class<?> superClass) {
        return new SupperClassTemplate(packageName, superClass).getClassList();
    }

    @Override
    public List<Class<?>> getAllImplClassWithoutInterface(String packageName) {
        return new WithoutInterfaceClassTemplate(packageName).getClassList();
    }
}
